﻿
Public NotInheritable Class SubscriptionManager

    Public Shared Function ReadSubscription(ByVal userId As Integer, ByVal publicKey As String, ByVal callbackAddress As String, _
                                            Optional ByVal application As DeviceTypeEnum = DeviceTypeEnum.BodyScale) As ReadSubscriptionResponse
        Dim retVal As ReadSubscriptionResponse
        Dim connector As Core.WBSAPIConnector


        connector = New Core.WBSAPIConnector
        retVal = connector.ReadSubscription(userID, publicKey, callbackAddress, application)
        connector = Nothing

        Return retVal

    End Function
    Public Shared Function CreateSubscription(ByVal userId As Integer, ByVal publicKey As String, _
                                              ByVal callbackAddress As String, ByVal comment As String, _
                                              Optional ByVal application As DeviceTypeEnum = DeviceTypeEnum.BodyScale) As SetSubscriptionResponse
        Dim retVal As SetSubscriptionResponse
        Dim connector As Core.WBSAPIConnector


        connector = New Core.WBSAPIConnector
        retVal = connector.CreateSubscribtion(userID, publicKey, callbackAddress, comment, application)
        connector = Nothing

        Return retVal

    End Function
    Public Shared Function RevokeSubscription(ByVal userId As Integer, ByVal publicKey As String, ByVal callbackAddress As String, _
                                              Optional ByVal application As DeviceTypeEnum = DeviceTypeEnum.BodyScale) As SetSubscriptionResponse
        Dim retVal As SetSubscriptionResponse
        Dim connector As Core.WBSAPIConnector


        connector = New Core.WBSAPIConnector
        retVal = connector.RevokeSubscription(userID, publicKey, callbackAddress, application)
        connector = Nothing

        Return retVal

    End Function

    Private Sub New()
    End Sub

End Class
